package com.ly.service;

import com.ly.bean.Admin;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
@author 李岩
@date 2021/12/14-13:52
@describe
*/
public interface AdminService{

    Admin selectByPrimaryKey(Integer aId) throws Exception;

    /*根据用户名获取admin对象*/
    Admin selectAdminByaName(String aName) throws Exception;

    //把登录信息保存到redis中
    void saveLloginAdminToRedis(Admin admin) throws  Exception;

    //从redis中获取用户信息
    Admin findLoginAdminFromRedis(Integer aId) throws Exception;

    //查询所有的管理员信息
    List<Admin> selectAllAdmin() throws Exception;

    //删除用户角色
    void deleteRoleByaId(Integer aId) throws Exception;

    //从redis中删除登录的用户信息
    void deleteLoginAdminFromRedis(Integer aId) throws Exception;

    //添加用户的角色
    void addRolesAdmins(@Param("roleId") Integer roleId, @Param("aId") Integer aId) throws Exception;

    //更改用户的角色
    void  updateRoleByaId(Integer aId,List<Integer> roleIds) throws Exception;
}
